package done.easy_101_200;

import com.study.common.TreeNode;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * 101. Symmetric Tree
 * <p>
 * 给定一个二叉树，检查它是否是镜像对称的。
 * 例如，二叉树 [1,2,2,3,4,4,3] 是对称的。
 * <p>
 * 1
 * / \
 * 2   2
 * / \ / \
 * 3  4 4  3
 * <p>
 * 但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的:
 * <p>
 * 1
 * / \
 * 2   2
 * \   \
 * 3    3
 * <p>
 * 2019-03-23 9:13 PM
 **/
@Slf4j
public class SymmetricTree {

    @SuppressWarnings("all")
    public boolean isSymmetric(TreeNode root) {
        //190323 first
        return false;
    }

    @Test
    public void test() {
        TreeNode root = new TreeNode(1,
                new TreeNode(2,
                        3, 4), new TreeNode(2,
                4, 3));
        log.info("result:{}", isSymmetric(root));
    }

}



























/*
public boolean isSymmetric(TreeNode root) {
    if (root==null)
        return true;

    return isSymmetric(root.left, root.right);
}

private Boolean isSymmetric(TreeNode left, TreeNode right) {
    if (left == null && right == null)
        return true;

    if (left != null && right == null
        || right != null && left == null
        || left.val != right.val)
        return false;

    return isSymmetric(left.left, right.right)
            && isSymmetric(left.right, right.left);
}
*/
